package com.mt.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

/**
 * @author Wang
 * @Description 电影厅类型枚举
 * @date 2020/12/23-0:08
 */
@Getter
public enum HallType {
    HD2D(0,"高清2D"),
    HD3D(1,"高清3D"),
    HD4D(2,"高清4D"),
    HD4K_3D(3,"4K高清3D"),
    IMAX(4,"IMAX"),
    DOLBY(5,"Dolby"),
    DTSX(6,"DTS:X"),
    CGS(7,"CGS 中国巨幕");

    @EnumValue
    private Integer code;
    @JsonValue
    private String msg;

    HallType(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }


    public static  int TypeCode(FilmListType listType) {
        for (FilmListType type :FilmListType.values()){
            if (type.getMsg()==listType.getMsg()) {
                return type.getCode();
            }
        }
        return -1;
    }

    public static  String TypeName(FilmListType listType) {
        for (FilmListType type :FilmListType.values()){
            if (type.getCode().equals(listType.getCode())) {
                return type.getMsg();
            }
        }
        return null;
    }


}
